<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"  name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=yes"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>资讯列表</title>
    <link rel="stylesheet" type="text/css" th:href="@{/pc/css/news_list.css}">
    <script th:src="@{/pc/js/jquery-1.8.2.min.js}"></script>
</head>
<body>
<div th:replace="pc/common/header :: header"></div>
<div id="content">
    <div class="list-left">
        <div class="cate-item">
            <div class="rcm-title">
                <div class="title-bar">&nbsp;</div>
                <div class="title-wd">推荐资讯</div>
            </div>
            <div class="cate-info">
                <dl class="cate-cont" th:each="r : ${recommandNewsList}">
                    <a th:href="${'/news/detail?id=' + r.id}">
                        <dt class="cate-title" th:text="${r.title}"></dt>
                        <dd class="cate-time" th:text="${r.time}"></dd>
                    </a>
                </dl>
            </div>
        </div>
    </div>
    <div class="list-right">
        <div class="list-title">
            <ul class="list-opt">
                <li th:each="c ,cStat : ${newsCategoryList}">
                    <a th:href="${'?categoryId=' + c.category.id }" th:class="${'opt-wd ' + (c.category.id == categoryId ? 'opt-active' : '')}" th:text="${c.category.categoryName}"></a>
                    <span th:class="${'opt-bar ' + (c.category.id == categoryId ? 'bar-active' : '')}"></span>
                </li>
            </ul>
        </div>
        <div class="news-list">
            <ul class="news-cont">
                <li class="news-item" th:each="n : ${normalNewsList.newsList}">
                    <a th:href="${'/news/detail?id=' + n.id}">
                        <div class="item-pic">
                          <img th:src="${n.picUrl+'?imageView2/1/w/223/h/123/q/75'}" alt="">
                        </div>
                        <div class="item-info">
                            <p class="item-title" th:text="${n.title}"></p>
                            <p class="item-time" th:text="${n.time}"></p>
                            <p class="item-cont" th:text="${#strings.abbreviate(n.text,142)}"></p>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
        <div class="list-page">
            <a th:if="${page > 1}" th:href="${'?categoryId=' + categoryId +'&page=' + (page-1)}" class="prev-page">上一页</a>
            <a th:if="${page <= 1}" href="javascript:void(0)" class="prev-page">上一页</a>
            <span class="page-num" th:text="${page + '/' + normalNewsList.pages}"></span>
            <a th:if="${page <  normalNewsList.pages}" th:href="${'?categoryId=' + categoryId +'&page=' + (page+1)}" class="next-page">下一页</a>
            <a th:if="${page >= normalNewsList.pages}" href="javascript:void(0)" class="next-page">下一页</a>
        </div>
    </div>
</div>
<div th:replace="pc/common/footer :: footer"></div>
</body>
</html>